consistently everywhere to ensure that setting it to 0 actually does disable the
feature. Also, tell the user that it is disabled if they happen to follow a link
with &action=markpatrolled in it. Additionally, make &action=markpatrolled say
"log in required" if the user is not logged in.
function view()
{
global $wgUser, $wgOut, $wgLang, $wgRequest, $wgMwRedir, $wgOnlySysopsCanPatrol;
- global $wgLinkCache, $IP, $wgEnableParserCache, $wgStylePath;
+ global $wgLinkCache, $IP, $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol;
$sk = $wgUser->getSkin();
$fname = 'Article::view';
# If we have been passed an &rcid= parameter, we want to give the user a
# chance to mark this new article as patrolled.
- if ( !is_null ( $rcid ) && $rcid != 0 && $wgUser->getID() != 0 &&
+ if ( $wgUseRCPatrol && !is_null ( $rcid ) && $rcid != 0 && $wgUser->getID() != 0 &&
( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
{
$wgOut->addHTML( wfMsg ( 'markaspatrolledlink',
# Mark this particular edit as patrolled
function markpatrolled()
{
- global $wgOut, $wgRequest, $wgOnlySysopsCanPatrol;
+ global $wgOut, $wgRequest, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
$wgOut->setRobotpolicy( 'noindex,follow' );
- if( $wgOnlySysopsCanPatrol && !$wgUser->isSysop() )
+
+ if ( !$wgUseRCPatrol )
+ {
+ $wgOut->errorpage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
+ return;
+ }
+ if ( $wgUser->getID() == 0 )
+ {
+ $wgOut->loginToUse();
+ return;
+ }
+ if ( $wgOnlySysopsCanPatrol && !$wgUser->isSysop() )
{
$wgOut->sysopRequired();
return;
} else {
$rollback = "";
}
- if ( $wgUseRCPatrol &&
- ($this->mRcidMarkPatrolled != 0 && $wgUser->getID() != 0 &&
- ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) ) )
+ if ( $wgUseRCPatrol && $this->mRcidMarkPatrolled != 0 && $wgUser->getID() != 0 &&
+ ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
{
$patrol = " [" . $sk->makeKnownLinkObj( $wgTitle, wfMsg( 'markaspatrolleddiff' ),
"action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . "]";
function recentChangesLineOld( &$rc, $watched = false )
{
- global $wgTitle, $wgLang, $wgUser, $wgRCSeconds, $wgUseRCPatrol;
+ global $wgTitle, $wgLang, $wgUser, $wgRCSeconds, $wgUseRCPatrol, $wgOnlySysopsCanPatrol;
# Extract DB fields into local scope
extract( $rc->mAttribs );
if ( $rc_type == RC_NEW || $rc_type == RC_LOG ) {
$diffLink = wfMsg( 'diff' );
} else {
- if ( $rc_patrolled == 0 && $wgUser->getID() != 0 &&
+ if ( $wgUseRCPatrol && $rc_patrolled == 0 && $wgUser->getID() != 0 &&
( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
$rcidparam = "&rcid={$rc_id}";
else
# Article link
# If it's a new article, there is no diff link, but if it hasn't been
# patrolled yet, we need to give users a way to do so
- if ( $rc_type == RC_NEW && $rc_patrolled == 0 && $wgUser->getID() != 0 &&
- ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
+ if ( $wgUseRCPatrol && $rc_type == RC_NEW && $rc_patrolled == 0 &&
+ $wgUser->getID() != 0 && ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
$articleLink = $this->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
else
$articleLink = $this->makeKnownLinkObj( $rc->getTitle(), '' );
}
function getSQL() {
- global $wgUser, $wgOnlySysopsCanPatrol;
- $usepatrol = ( $wgUser->getID() != 0 && ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) ) ? 1 : 0;
+ global $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
+ $usepatrol = ( $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) ) ? 1 : 0;
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'recentchanges', 'cur' ) );
}
function formatResult( $skin, $result ) {
- global $wgLang, $wgUser, $wgOnlySysopsCanPatrol;
+ global $wgLang, $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
$u = $result->user;
$ut = $result->user_text;
$length = wfMsg( "nbytes", $wgLang->formatNum( $result->length ) );
$c = $skin->formatComment($result->comment );
- if ( 0 == $u ) { # not by a logged-in user
+ if ( $u == 0 ) { # not by a logged-in user
$ul = $ut;
}
else {
# Since there is no diff link, we need to give users a way to
# mark the article as patrolled if it isn't already
- if ( $result->usepatrol && $result->patrolled == 0 && $wgUser->getID() != 0 &&
- ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
+ if ( $wgUseRCPatrol && $result->usepatrol && $result->patrolled == 0 &&
+ $wgUser->getID() != 0 && ( $wgUser->isSysop() || !$wgOnlySysopsCanPatrol ) )
$link = $skin->makeKnownLink( $result->title, '', "rcid={$result->rcid}" );
else
$link = $skin->makeKnownLink( $result->title, '' );
'markaspatrolledtext' => "Mark this article as patrolled",
'markedaspatrolled' => "Marked as patrolled",
'markedaspatrolledtext' => "The selected revision has been marked as patrolled.",
+'rcpatroldisabled' => "Recent Changes Patrol disabled",
+'rcpatroldisabledtext' => "The Recent Changes Patrol feature is currently disabled.",
# Monobook.js: tooltips and access keys for monobook
'Monobook.js' => '/* tooltips and access keys */